package edu.nf.relaxenjoy.common.exception;

/**
 * 异常枚举
 * @author zhu
 * @date 2024-10-12
 */
public enum ErrorsEnum {

    /**
     * 登录异常
     */
    LOGIN_EXCEPTION(10000, "账号或密码错误"),

    /**
     * 数据访问异常
     */
    DATA_ACCESS_EXCEPTION(10002, "数据访问异常"),

    /**
     * 验证用户是否登录
     */
    AUTH_EXCEPTION(401, "用户未登录"),

    /**
     * token异常
     */
    TOKEN_FAIL(501, "token异常"),

    /**
     * 空值
     */
    NOY_NULL(10001, "为空"),

    /**
     * 失败原因
     */
    FAIL(201, "失败");

    private final Integer errorCode;
    private final String errorMessage;

    ErrorsEnum(Integer errorCode, String errorMessage) {
        this.errorCode = errorCode;
        this.errorMessage = errorMessage;
    }

    public Integer errorCode(){
        return errorCode;
    }

    public String errorMessage(){
        return errorMessage;
    }
}
